<?php
	header("content-type:text/html;charset=utf8");
	$pdo = new PDO('mysql:host=127.0.0.1;dbname=kycp;charset=utf8','root','root');
	$id = $_GET['id'];
	$name = $_POST['name'];
	$pwd = md5($_POST['pwd']);
	$age = $_POST['age'];
	$sex = $_POST['sex'];
	$phone = $_POST['phone'];
	$id_card = $_POST['id_card'];
	//$add_time = time();
	//$ip=ip2long($_SERVER['REMOTE_ADDR']);
	$sql = "update ceshi set name='$name',pwd='$pwd',age='$age',sex='$sex',phone='$phone',id_card='$id_card' where id='$id'";
	$data = $pdo->exec($sql);
	if($data){
		echo "<script>alert('修改成功');location.href='show.php';</script>";//修改成功，返回展示页面
	}else{
		echo "<script>alert('修改失败');</script>";//修改失败
	}
?>